<template>
  <div class="content">
    <!--    用户列表弹窗-->
    <el-dialog
        title="用户列表"
        model
        v-model="isclientlDialog"
        width="800px"
        append-to-body
        :before-close="handleClose"
    >
      <div>
        <el-table
            :data="userList"
            @row-dblclick="rowClick"
        >
          <el-table-column label="用户名称" align="center" key="userName" prop="userName"  :show-overflow-tooltip="true" />
          <el-table-column label="用户昵称" align="center" key="nickName" prop="nickName" :show-overflow-tooltip="true" />
          <el-table-column label="部门" align="center" key="deptName" prop="dept.deptName"  :show-overflow-tooltip="true" />
          <el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" width="120" />
          <el-table-column label="状态" align="center" key="status">
            <template #default="scope">
              <el-switch
                  v-model="scope.row.status"
                  active-value="0"
                  inactive-value="1"
                  disabled
              ></el-switch>
            </template>
          </el-table-column>
          <el-table-column label="创建时间" align="center" prop="createTime" width="160">
            <template #default="scope">
              <span>{{ parseTime(scope.row.createTime) }}</span>
            </template>
          </el-table-column>
        </el-table>
        <pagination
            v-show="total > 0"
            :total="total"
            v-model:page="queryParams.pageNum"
            v-model:limit="queryParams.pageSize"
            @pagination="getList"
        />
      </div>
    </el-dialog>
  </div>
</template>
<script>
import { listUser } from "@/api/system/user";
export default {
  props: {
    msg: {
      type: String,
      default: ''
    },
    priDa: {
      type: Object,
      default: function() {
        return {}
      }
    }
  },
  data() {
    return {
      // 客户列表数据分页
      isclientlDialog: true,
      selPrint: [],
      userList: [],
      total: 0,
      queryParams: {
        pageNum: 1,
        pageSize: 20,
        userName: undefined,
        phonenumber: undefined,
        status: undefined,
        deptId: undefined
      },
    }
  },
  created() {
    this.getList()
  },
  methods: {
    /** 查询用户列表 */
     getList() {
      listUser(this.queryParams).then(res => {
        this.userList = res.rows;
        this.total = res.total;
      });
    },
    rowClick(ev) {
      console.log(ev, 11)
       this.$emit('user', ev)
    },
    // 关闭前回调
    handleClose() {
      this.$emit('close')
    }
  }
}
</script>

<style scoped lang="scss">
.content {
}
</style>
